Method and Apparatus for Obtaining Emission Probability, Method and Apparatus for Obtaining Transition Probability, and Sequence Positioning Method and Apparatus

ABSTRACT

A method for obtaining an emission probability includes obtaining a plurality of measurement reports (MRs) of a terminal in a target region and an engineering parameter of at least one base station in the target region, obtaining, based on parameter information in each of the plurality of MRs and the engineering parameter of the at least one base station, a feature vector corresponding to each of the plurality of MRs, processing, using a regression model, location information in each of the plurality of MRs and the feature vector corresponding to each of the plurality of MRs, to obtain a single-point positioning model, calculating, based on the single-point positioning model, the location information in each of the plurality of MRs, and the feature vector corresponding to each of the plurality of MRs, an emission probability of the feature vector corresponding to each of the plurality of MRs.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a continuation of International Patent ApplicationNo. PCT/CN2017/108647, filed on Oct. 31, 2017, which claims priority toChinese Patent Application No. 201710698562.1, filed on Aug. 15, 2017.The disclosures of the aforementioned applications are herebyincorporated by reference in their entireties.

TECHNICAL FIELD

The present disclosure relates to the field of telecommunicationpositioning, and in particular, to a method and an apparatus forobtaining an emission probability used for sequence positioning.

BACKGROUND

Telecommunication positioning means obtaining a location of a mobiledevice through calculation using data sent by the mobile device to apipeline side (such as a telecommunications operator) and data on a basestation side. Currently, common telecommunication positioningtechnologies include a range-based method, a fingerprint method, and asequence positioning method. A main idea of the sequence positioningmethod (or a sequence method) is to describe a positioning process as amodel of matching from an observed sequence to a hidden sequence, wherea latitude and longitude location is used as a hidden state, and signalstrength is used as an observed value. During positioning, an observedvalue sequence is used as input, and an optimal hidden state sequence ina one-to-one correspondence with the input observed value sequence isoutput as a positioning result. A core of the positioning method is todefine an emission probability and a transition probability. Theemission probability means mapping from a hidden state to an observedvalue. The transition probability means transition between differenthidden states.

The sequence positioning method has the following main advantage.Context information of a location is used such that a prediction resultof each location can be restricted by a previous location, and arelatively smooth track is obtained, thereby effectively avoiding a casein which a prediction result obtained using a method such as therange-based method and the fingerprint method “jumps”. Obtaining of theemission probability and the transition probability directly affects apositioning capability of the sequence positioning method. In otherapproaches, the emission probability is obtained by modeling a meansquare error of signal strength. The emission probability obtained usingthe method cannot describe complex observed information. This directlyaffects positioning precision and reliability of the sequencepositioning method.

SUMMARY

To resolve a technical problem in other approaches, this applicationprovides a method for obtaining an emission probability such that anobtained emission probability can express complex observed information,and using the emission probability for sequence positioning can improvepositioning precision and reliability of a sequence positioning method.

According to a first aspect, this application provides a method forobtaining an emission probability. The method includes obtaining aplurality of measurement reports (MRs) of a terminal in a target regionand an engineering parameter of at least one base station in the targetregion, where the target region is a predetermined geographical region.Specifically, the target region may be obtained through division basedon a population quantity and an administrative region. For example, asuburb of a city is a target region or an urban region of a city is atarget region. An area size, a geographical location, and the like ofthe target region are not limited in this application. Generally, anemission probability obtained based on an MR of a terminal in a regionis applied to the region. It should be noted that, the obtaining aplurality of MRs of a terminal in a target region may be obtaining aplurality of MRs of one terminal in the target region, or may beobtaining a plurality of MRs of a plurality of terminals in the targetregion. In addition, a quantity of MRs of one terminal is not limited,and the plurality of terminals may have one or more MRs. Each of theplurality of MRs includes location information and parameterinformation. The location information is used to indicate a locationthat is in the target region and that is of a terminal corresponding tothe MR including the location information. Parameter information in anMR is not limited in this application. Generally, information other thanlocation information in the MR may be parameter information.

Optionally, the parameter information includes an environment parameter.The environment parameter is used to indicate an environment in which aterminal corresponding to an MR including the environment parameter islocated, for example, time period information, weather information, andevent information (a holiday, a celebration day, a sports meeting, orthe like). Different emission probabilities are obtained based ondifferent environments, and the environment parameter is used as afeature such that positioning in different environments can be moreaccurately supported.

The method further includes obtaining, based on the parameterinformation in each of the plurality of MRs and the engineeringparameter of the at least one base station, a feature vectorcorresponding to each of the plurality of MRs, where the parameterinformation includes a plurality of pieces of information, and a featurevector obtained using the parameter information and an engineeringparameter of a corresponding base station can express complex observedinformation, processing, using a machine learning model, the locationinformation in each of the plurality of MRs and the feature vectorcorresponding to each of the plurality of MRs, to obtain a single-pointpositioning model, and calculating, based on the single-pointpositioning model, the location information in each of the plurality ofMRs, and the feature vector corresponding to each of the plurality ofMRs, an emission probability of the feature vector corresponding to eachof the plurality of MRs, where the emission probability includes atleast one emission probability value, and the emission probability valueis used to indicate a probability that a feature vector corresponds to apiece of location information. It should be noted that, an MR that isinput into the single-point positioning model and an MR that is used totrain the single-point positioning model may not be limited to MRs of asame terminal, and may alternatively be MRs of a terminal other than theterminal in the target region, that is, the MR that is used to obtainthe single-point positioning model and the MR that is used to be inputinto the single-point positioning model to calculate the emissionprobability may be MRs uploaded by different terminals in the targetregion. The single-point positioning model is obtained through trainingusing MRs of a terminal in the target region, then MRs of the terminalin the target region is input into the single-point positioning model,and a correspondence between a feature vector and location informationis obtained through statistics collection using a spatial model of thesingle-point positioning model such that the correspondence is morereliable.

In a possible implementation of the first aspect, the parameterinformation in each of the plurality of MRs includes at least one basestation identifier (ID), and the base station ID is used to indicate abase station to which a terminal corresponding to an MR including thebase station ID is connected. Actually, one MR may include informationabout a plurality of base stations to which a corresponding terminal isconnected. The at least one base station includes at least base stationsindicated by base station IDs included in the plurality of MRs such thatthe base station ID in each MR corresponds to an engineering parameterused to obtain a feature vector. The obtaining, based on the parameterinformation in each of the plurality of MRs and the engineeringparameter of the at least one base station, a feature vectorcorresponding to each of the plurality of MRs includes matching theplurality of MRs with the engineering parameter of the at least one basestation based on the base station IDs, to obtain an associatedengineering parameter of each of the plurality of MRs, where anassociated engineering parameter of any MR includes an engineeringparameter of a base station indicated by each base station ID in the anyMR, and obtaining, based on the associated engineering parameter and theparameter information of each of the plurality of MRs, the featurevector corresponding to each of the plurality of MRs, where any featurevector includes an associated engineering parameter and parameterinformation of one MR. It should be noted that a quantity of basestations indicated by a base station ID in a corresponding MR generallydetermines that engineering parameters of how many base stations can beincluded in a feature vector. Optionally, the feature vector may includeonly one engineering parameter of at least one base station indicated byat least one base station ID included in the corresponding MR.

In a possible implementation of the first aspect, the processing, usinga machine learning model, the location information in each of theplurality of MRs and the feature vector corresponding to each of theplurality of MRs, to obtain a single-point positioning model includesobtaining, based on the location information in each of the plurality ofMRs and the feature vector corresponding to each of the plurality ofMRs, a training set corresponding to each of the plurality of MRs, whereany training set includes a feature vector and location information thatcorrespond to one MR, and inputting, into the machine learning model fortraining, the training set corresponding to each of the plurality ofMRs, to obtain the single-point positioning model.

In a possible implementation of the first aspect, the calculating, basedon the single-point positioning model, the location information in eachof the plurality of MRs, and the feature vector corresponding to each ofthe plurality of MRs, an emission probability of the feature vectorcorresponding to each of the plurality of MRs includes inputting, intothe single-point positioning model, the location information in each ofthe plurality of MRs and the feature vector corresponding to each of theplurality of MRs, to obtain a mapping relationship, where the mappingrelationship is used to indicate a correspondence between a featurevector and location information, and calculating, based on the mappingrelationship, the emission probability of the feature vectorcorresponding to each of the plurality of MRs. Optionally, featurevectors corresponding to MRs that are input into the single-pointpositioning model and location information in the MRs may not be thefeature vectors corresponding to the MRs of the terminal and thelocation information in the MRs, and may be MRs of a plurality of otherterminals in a same target region as the terminal. In addition, a methodfor obtaining the feature vectors is the same as a method for obtainingthe feature vectors corresponding to the MRs of the terminal. Detailsare not described herein again.

In a possible implementation of the first aspect, the machine learningmodel is a regression model, for example, logistic regression or arandom forest, and a specific model of the regression model is notlimited herein.

According to the method for obtaining an emission probability providedin this application, feature vectors obtained using a plurality ofpieces of parameter information in MRs and engineering parameters ofcorresponding base stations are used as observed values, and then asingle-point positioning model is trained using the feature vectors andlocation information that correspond to the MRs such that an emissionprobability obtained using a spatial model of the single-pointpositioning model can express complex observed information, and acorrespondence between a feature vector (an observed value) and locationinformation is more reliable.

According to a second aspect, the present disclosures provides a methodfor obtaining a transition probability. The method includes obtaining aplurality of pieces of track data of a terminal in a target region,where the target region is a predetermined geographical region.Specifically, the target region may be obtained through division basedon a population quantity and an administrative region. For example, asuburb of a city is a target region or an urban region of a city is atarget region. An area size, a geographical location, and the like ofthe target region are not limited in this application. Generally, anemission probability obtained based on an MR of a terminal in a regionis applied to the region. Each of the plurality of pieces of track dataincludes at least two pieces of location information. The locationinformation is used to indicate a location that is in the target regionand that is of a terminal corresponding to track data including thelocation information. Each of a plurality of pieces of locationinformation included in the plurality of pieces of track datacorresponds to a time stamp. The method further includes calculating atransition probability based on the plurality of pieces of track data,where the transition probability includes at least one transitionprobability value, and the transition probability value is used toindicate a probability that movement is performed from a piece oflocation information to another piece of location information after atime interval T. Optionally, the plurality of pieces of track data ofthe terminal in the target region are from a third-party platform, forexample, a third-party app such as Didi Chuxing or a bicycle-sharingplatform.

Optionally, the plurality of pieces of track data include a sameenvironment parameter. The environment parameter is used to indicate anenvironment in which a terminal corresponding to track data includingthe environment parameter is located, for example, at least one of timeperiod information, weather information, and event information.Different transition probabilities are obtained based on differentenvironments, and the environment parameter is used as an identifiersuch that positioning in different environments can be more accuratelysupported.

In a possible implementation of the second aspect, the calculating atransition probability based on the plurality of pieces of track dataincludes processing the plurality of pieces of track data to obtain atleast one combination sequence of each of the plurality of pieces oftrack data, where the combination sequence includes any two pieces oflocation information in one piece of track data and a time intervalbetween the any two pieces of location information, and a time intervalbetween two pieces of location information may be obtained throughcalculation based on time stamps respectively corresponding to the twopieces of location information, and obtaining, based on a first presetcondition and the at least one combination sequence of each of theplurality of pieces of track data, a transition probabilitycorresponding to the first preset condition, where the first presetcondition is any one of a plurality of preset conditions, each of theplurality of preset conditions includes a preset time interval andpreset location information, the preset time interval corresponds to thetime interval T, and the preset location information corresponds to thepiece of location information.

In a possible implementation of the second aspect, the obtaining, basedon a first preset condition and the at least one combination sequence ofeach of the plurality of pieces of track data, a transition probabilitycorresponding to the first preset condition includes determiningcombination sequences that include a preset time interval and presetlocation information in the first preset condition and that are in allcombination sequences included in the plurality of pieces of track data,and collecting statistics about the combination sequences that includethe preset time interval and the preset location information in thepreset condition, and calculating the transition probabilitycorresponding to the first preset condition. For example, it isdetermined that a quantity of all combination sequences that includelocation information A and a time interval T1 is M, and the combinationsequences may be represented as [location information A, time intervalT1, and location information X_(n)]. A quantity of pieces of each oflocation information X₁ to X_(n) is counted in all the combinationsequences that include the location information A and the time intervalT1, to obtain a probability value that each of the location informationX₁ to X_(n) occupies in M. The probability values that correspond to thelocation information X₁ to X_(n) constitute a transition probabilitycorresponding to the condition including the location information A andthe time interval T1. Optionally, the preset time interval is a presettime interval range, and the preset time interval may be specificduration or a duration range. For example, the preset time interval is 2seconds, or the preset time interval is 2 seconds to 4 seconds. In thisway, a transition probability corresponding to a duration range can beobtained. Because different terminals may obtain MRs at differentfrequencies, time intervals in combination sequences obtained usingtrack data of different terminals may be different. The time interval inthe preset condition is set to a value range such that combinationsequences corresponding to different time intervals may be fused to useexisting data to a maximum extent.

In a possible implementation of the second aspect, before thecalculating a transition probability based on the plurality of pieces oftrack data, the method further includes removing defective track datafrom the plurality of pieces of track data, where the defective trackdata is track data in which at least one piece of location informationdeviates from a road in the target region by a distance greater than afirst threshold, or is track data in which a distance between two piecesof adjacent location information is greater than a second threshold. Inpractice, unreliable data, namely, defective track data, may exist intrack data obtained from a third party. The defective track data isremoved from the obtained plurality of pieces of track data, and thenfurther processing continues to be performed on track data obtainedafter the removal, to obtain the transition probability such that amovement track of the terminal recovered/predicted using the transitionprobability can be more reliable and smooth.

In a possible implementation of the second aspect, before thecalculating a transition probability based on the plurality of pieces oftrack data, the method further includes determining sparse track data inthe plurality of pieces of track data, where the sparse track data istrack data in which a distance between any two pieces of adjacentlocation information in the at least two pieces of location informationincluded in the track data is greater than a third threshold, andinserting one or more pieces of location information between the any twopieces of adjacent location information in the sparse track data basedon map information of the target region. Interpolation processing isperformed such that location information in obtained track data can bedenser. A transition probability obtained based on the track dataobtained after the interpolation processing is used to recover/predictthe movement track of the terminal such that the recovered/predictedmovement track can be smoother. In addition, transition probabilitiescorresponding to more different time intervals can be obtained. In apossible implementation of the second aspect, the obtaining a pluralityof pieces of track data of a terminal in a target region includesobtaining the plurality of pieces of track data of the terminal in thetarget region in a peak traffic time period or a non-peak traffic timeperiod. In practice, a movement track of the terminal in the peaktraffic time period is usually different from a movement track of theterminal in the non-peak traffic time period. Different transitionprobabilities obtained in the peak traffic time period and the non-peaktraffic period are used to recover/predict a movement track of theterminal in a corresponding time period such that accuracy andreliability of recovering/predicting the movement track of the terminalcan be improved.

According to the method for obtaining a transition probability providedin this application, a transition probability calculated based onmovement track data that is of a terminal in a target region and that isprovided by a third-party platform is used to recover or predict amovement track of a terminal in the target region such that the movementtrack is smoother, and track jumping can effectively be avoided.

According to a third aspect, this application provides a sequencepositioning method. The method includes obtaining a plurality of targetMRs of a target terminal in a target region and an engineering parameterof at least one base station in the target region, where the targetregion is a predetermined geographical region, and each of the pluralityof target MRs includes parameter information, obtaining, based on theparameter information in each of the plurality of target MRs and theengineering parameter of the at least one base station, a target featurevector corresponding to each of the plurality of target MRs, andinputting, into a sequence positioning model, the target feature vectorcorresponding to each of the plurality of target MRs, to obtain amovement track of the target terminal. Application parameters of thesequence positioning model include an emission probability and atransition probability. The emission probability may be obtained usingthe method according to any one of the first aspect or the possibleimplementations of the first aspect, and/or the transition probabilitymay be obtained using the method according to any one of the secondaspect or the possible implementations of the second aspect. Details arenot described herein again.

According to the sequence positioning method provided in thisapplication, an emission probability obtained based on feature vectorsobtained based on a plurality of pieces of parameter information in MRsand engineering parameters of corresponding base stations can expressmore complex observed information, thereby further improving accuracyand reliability of a movement track recovered/predicted through sequencepositioning.

According to a fourth aspect, this application provides a sequencepositioning method. The method includes obtaining a plurality of targetMRs of a target terminal in a target region and an engineering parameterof at least one base station in the target region, where the targetregion is a predetermined geographical region, and each of the pluralityof target MRs includes parameter information, obtaining, based on theparameter information in each of the plurality of target MRs and theengineering parameter of the at least one base station, a target featurevector corresponding to each of the plurality of target MRs, andinputting, into a sequence positioning model, the target feature vectorcorresponding to each of the plurality of target MRs, to obtain amovement track of the target terminal.

Application parameters of the sequence positioning model include anemission probability and a transition probability. The transitionprobability is obtained using the following method obtaining a pluralityof pieces of track data of a terminal in the target region, where eachof the plurality of pieces of track data of the terminal includes atleast two pieces of second location information, the second locationinformation is used to indicate a location that is in the target regionand that is of a terminal corresponding to track data including thesecond location information, and each of a plurality of second locationinformation included in the plurality of pieces of track data of theterminal corresponds to a time stamp, and calculating a transitionprobability based on the plurality of pieces of track data of theterminal, where the transition probability includes at least onetransition probability value, and the transition probability value isused to indicate a probability that movement is performed from a pieceof second location information to another piece of second locationinformation after a time interval T.

In a possible implementation of the fourth aspect, the calculating atransition probability based on the plurality of pieces of track data ofthe terminal includes processing the plurality of pieces of track dataof the terminal to obtain at least one combination sequence of each ofthe plurality of pieces of track data of the terminal, where thecombination sequence includes any two pieces of second locationinformation in one piece of track data of the terminal and a timeinterval between the any two pieces of second location information, andobtaining, based on a first preset condition and the at least onecombination sequence of each of the plurality of pieces of track data ofthe terminal, a transition probability corresponding to the first presetcondition, where the first preset condition is any one of a plurality ofpreset conditions, each of the plurality of preset conditions includes apreset time interval and preset second location information, the presettime interval corresponds to the time interval T, and the preset secondlocation information corresponds to the piece of second locationinformation.

In a possible implementation of the fourth aspect, the obtaining, basedon a first preset condition and the at least one combination sequence ofeach of the plurality of pieces of track data of the terminal, atransition probability corresponding to the first preset conditionincludes determining combination sequences that include a preset timeinterval and preset second location information in the first presetcondition and that are in all combination sequences included in theplurality of pieces of track data of the terminal, and collectingstatistics about the combination sequences that include the preset timeinterval and the preset second location information in the presetcondition, and calculating the transition probability corresponding tothe first preset condition.

In a possible implementation of the fourth aspect, before thecalculating a transition probability based on the plurality of pieces oftrack data of the terminal, the method further includes removingdefective track data from the plurality of pieces of track data of theterminal, where the defective track data is track data in which at leastone piece of second location information deviates from a road in thetarget region by a distance greater than a first threshold, or is trackdata in which a distance between two pieces of adjacent second locationinformation is greater than a second threshold.

In a possible implementation of the fourth aspect, before thecalculating a transition probability based on the plurality of pieces oftrack data of the terminal, the method further includes determiningsparse track data in the plurality of pieces of track data of theterminal, where the sparse track data is track data in which a distancebetween any two pieces of adjacent second location information in the atleast two pieces of second location information included in the trackdata is greater than a third threshold, and inserting one or more piecesof second location information between the any two pieces of adjacentsecond location information in the sparse track data based on mapinformation of the target region.

In a possible implementation of the fourth aspect, the obtaining aplurality of pieces of track data of a terminal in the target regionincludes obtaining the plurality of pieces of track data of the terminalin the target region in a peak traffic time period or a non-peak traffictime period.

In a possible implementation of the fourth aspect, the preset timeinterval is a preset time interval range.

In a possible implementation of the fourth aspect, the emissionprobability is obtained using the method according to any one of thefirst aspect or the possible implementations of the first aspect.

According to the sequence positioning method provided in thisapplication, a transition probability obtained using real track datafrom a third party is used for sequence positioning such that smoothnessof a recovered/predicted movement track can be improved, and theobtained movement track is more reliable.

According to a fifth aspect, this application provides an apparatus forcalculating an emission probability, where the apparatus for calculatingan emission probability includes a MR obtaining module, a feature vectormodule, a regression processing module, and an emission probabilitycalculation module. The MR obtaining module is configured to obtain aplurality of MRs of a terminal in a target region and an engineeringparameter of at least one base station in the target region, where thetarget region is a predetermined geographical region, each of theplurality of MRs includes location information and parameterinformation, and the location information is used to indicate a locationthat is in the target region and that is of a terminal corresponding tothe MR including the location information. The feature vector module isconfigured to obtain, based on the parameter information in each of theplurality of MRs and the engineering parameter of the at least one basestation that are obtained by the MR obtaining module, a feature vectorcorresponding to each of the plurality of MRs. The regression processingmodule is configured to obtain a single-point positioning model based onthe location information in each of the plurality of MRs obtained by theMR obtaining module and the feature vector that corresponds to each ofthe plurality of MRs and that is obtained by the feature vector module.The emission probability calculation module is configured to calculate,based on the single-point positioning model obtained by the regressionprocessing module, the location information in each of the plurality ofMRs obtained by the MR obtaining module, and the feature vector thatcorresponds to each of the plurality of MRs and that is obtained by thefeature vector module, an emission probability of the feature vectorcorresponding to each of the plurality of MRs, where the emissionprobability includes at least one emission probability value, and theemission probability value is used to indicate a probability that afeature vector corresponds to a piece of location information.

In a possible implementation of the fifth aspect, the parameterinformation in each of the plurality of MRs includes at least one basestation ID, the base station ID is used to indicate a base station towhich a terminal corresponding to an MR including the base station ID isconnected, and the at least one base station includes at least basestations indicated by base station IDs included in the plurality of MRs,and the feature vector module is further configured to match, based onthe base station IDs, the plurality of MRs obtained by the MR obtainingmodule with the engineering parameter of the at least one base stationobtained by the MR obtaining module, to obtain an associated engineeringparameter of each of the plurality of MRs, where an associatedengineering parameter of any MR includes an engineering parameter of abase station indicated by each base station ID in the any MR, andobtain, based on the associated engineering parameter and the parameterinformation of each of the plurality of MRs obtained by the MR obtainingmodule, the feature vector corresponding to each of the plurality ofMRs, where any feature vector includes an associated engineeringparameter and parameter information of one MR.

In a possible implementation of the fifth aspect, the regressionprocessing module is further configured to obtain, based on the locationinformation in each of the plurality of MRs obtained by the MR obtainingmodule and the feature vector that corresponds to each of the pluralityof MRs and that is obtained by the feature vector module, a training setcorresponding to each of the plurality of MRs, where any training setincludes a feature vector and location information that correspond toone MR, and input, into the machine learning model for training, thetraining set corresponding to each of the plurality of MRs, to obtainthe single-point positioning model.

In a possible implementation of the fifth aspect, the emissionprobability calculation module is further configured to input, into thesingle-point positioning model obtained by the regression processingmodule, the location information in each of the plurality of MRsobtained by the MR obtaining module and the feature vector thatcorresponds to each of the plurality of MRs and that is obtained by thefeature vector module, to obtain a mapping relationship, where themapping relationship is used to indicate a correspondence between afeature vector and location information, and calculate, based on themapping relationship, the emission probability of the feature vectorcorresponding to each of the plurality of MRs.

According to the apparatus for calculating an emission probabilityprovided in this application, feature vectors obtained using a pluralityof pieces of parameter information in MRs and engineering parameters ofcorresponding base stations are used as observed values, and then asingle-point positioning model is trained using the feature vectors andlocation information that correspond to the MRs such that an emissionprobability obtained using a spatial model of the single-pointpositioning model can express complex observed information, and acorrespondence between a feature vector (an observed value) and locationinformation is more reliable.

According to a sixth aspect, this application provides an apparatus forcalculating a transition probability, where the apparatus forcalculating a transition probability includes a track obtaining moduleand a transition probability calculation module. The track obtainingmodule is configured to obtain a plurality of pieces of track data of aterminal in a target region, where the target region is a predeterminedgeographical region, each of the plurality of pieces of track dataincludes at least two pieces of location information, the locationinformation is used to indicate a location that is in the target regionand that is of a terminal corresponding to track data including thelocation information, and each of a plurality of pieces of locationinformation included in the plurality of pieces of track datacorresponds to a time stamp. The transition probability calculationmodule is configured to calculate a transition probability based on theplurality of pieces of track data obtained by the track obtainingmodule, where the transition probability includes at least onetransition probability value, and the transition probability value isused to indicate a probability that movement is performed from a pieceof location information to another piece of location information after atime interval T. Optionally, a plurality of pieces of track data of theterminal in the target region in a peak traffic time period or anon-peak traffic time period are obtained.

In a possible implementation of the sixth aspect, the transitionprobability calculation module includes a preprocessing unit and atransition probability calculation unit. The preprocessing unit isconfigured to process the plurality of pieces of track data obtained bythe track obtaining module, to obtain at least one combination sequenceof each of the plurality of pieces of track data, where the combinationsequence includes any two pieces of location information in one piece oftrack data and a time interval between the any two pieces of locationinformation. The transition probability calculation unit is configuredto obtain, based on a first preset condition and the at least onecombination sequence that is of each of the plurality of pieces of trackdata and that is obtained by the preprocessing unit, a transitionprobability corresponding to the first preset condition, where the firstpreset condition is any one of a plurality of preset conditions, each ofthe plurality of preset conditions includes a preset time interval andpreset location information, the preset time interval corresponds to thetime interval T, and the preset location information corresponds to thepiece of location information. Optionally, the preset time interval is apreset time interval range.

In a possible implementation of the sixth aspect, the transitionprobability calculation unit is further configured to determinecombination sequences that include a preset time interval and presetlocation information in the first preset condition and that are in allcombination sequences that are included in the plurality of pieces oftrack data and that are obtained by the preprocessing unit, and collectstatistics about the combination sequences that include the preset timeinterval and the preset location information in the preset condition,and calculate the transition probability corresponding to the firstpreset condition.

In a possible implementation of the sixth aspect, the apparatus furtherincludes a first track processing module. The first track processingmodule is configured to remove defective track data from the pluralityof pieces of track data obtained by the track obtaining module, wherethe defective track data is track data in which at least one piece oflocation information deviates from a road in the target region by adistance greater than a first threshold, or is track data in which adistance between two pieces of adjacent location information is greaterthan a second threshold.

In a possible implementation of the sixth aspect, the apparatus furtherincludes a second track processing module. The second track processingmodule is configured to determine sparse track data in the plurality ofpieces of track data obtained by the track obtaining module, where thesparse track data is track data in which a distance between any twopieces of adjacent location information in the at least two pieces oflocation information included in the track data is greater than a thirdthreshold, and insert one or more pieces of location information betweenthe any two pieces of adjacent location information in the sparse trackdata based on map information of the target region.

According to the apparatus for calculating a transition probabilityprovided in this application, a transition probability calculated basedon movement track data that is of a terminal in a target region and thatis provided by a third-party platform is used to recover or predict amovement track of a terminal in the target region such that the movementtrack is smoother, and track jumping can effectively be avoided.

According to a seventh aspect, this application provides a sequencepositioning apparatus, where the sequence positioning apparatus includesan emission probability calculation module, a transition probabilitycalculation module, and a sequence positioning module.

The sequence positioning module includes a target MR obtaining unit, atarget feature vector unit, and a track prediction unit. The target MRunit is configured to obtain a plurality of target MRs of a targetterminal in a target region and an engineering parameter of at least onebase station in the target region, where the target region is apredetermined geographical region, and each of the plurality of targetMRs includes parameter information. The target feature vector unit isconfigured to obtain, based on the parameter information in each of theplurality of target MRs and the engineering parameter of the at leastone base station that are obtained by the target MR unit, a targetfeature vector corresponding to each of the plurality of target MRs. Thetrack prediction unit is configured to obtain a movement track of thetarget terminal based on the target feature vector that corresponds toeach of the plurality of target MRs and that is obtained by the targetfeature vector unit. Application parameters of the sequence positioningmodel include an emission probability and a transition probability.

The emission probability calculation module is configured to calculatethe emission probability, and the transition probability calculationmodule is configured to calculate the transition probability.

The emission probability calculation module includes a MR obtainingunit, a feature vector unit, a regression processing unit, and anemission probability calculation unit. The MR obtaining unit isconfigured to obtain a plurality of MRs of a first terminal in thetarget region and the engineering parameter of the at least one basestation in the target region, where each of the plurality of MRsincludes location information and parameter information, and thelocation information is used to indicate a location that is in thetarget region and that is of a first terminal corresponding to the MRincluding the location information. The feature vector unit isconfigured to obtain, based on the parameter information in each of theplurality of MRs and the engineering parameter of the at least one basestation that are obtained by the MR obtaining unit, a feature vectorcorresponding to each of the plurality of MRs. The regression processingunit is configured to obtain a single-point positioning model based onthe location information in each of the plurality of MRs obtained by theMR obtaining unit and the feature vector that corresponds to each of theplurality of MRs and that is obtained by the feature vector unit. Theemission probability calculation unit is configured to calculate, basedon the single-point positioning model obtained by the regressionprocessing unit, the location information in each of the plurality ofMRs obtained by the MR obtaining unit, and the feature vector thatcorresponds to each of the plurality of MRs and that is obtained by thefeature vector unit, an emission probability of the feature vectorcorresponding to each of the plurality of MRs, where the emissionprobability includes at least one emission probability value, and theemission probability value is used to indicate a probability that afeature vector corresponds to a piece of location information.

Alternatively, the transition probability calculation module includes atrack obtaining unit and a transition probability calculation unit. Thetrack obtaining unit is configured to obtain a plurality of pieces oftrack data of a second terminal in the target region, where each of theplurality of pieces of track data includes at least two pieces oflocation information, the location information is used to indicate alocation that is in the target region and that is of a second terminalcorresponding to track data including the location information, and eachof a plurality of pieces of location information included in theplurality of pieces of track data corresponds to a time stamp. Thetransition probability calculation unit is configured to calculate atransition probability based on the plurality of pieces of track dataobtained by the track obtaining unit, where the transition probabilityincludes at least one transition probability value, and the transitionprobability value is used to indicate a probability that movement isperformed from a piece of location information to another piece oflocation information after a time interval T.

In a possible implementation of the seventh aspect, the parameterinformation in each of the plurality of MRs includes at least one basestation ID, the base station ID is used to indicate a base station towhich a first terminal corresponding to an MR including the base stationID is connected, and the at least one base station includes at leastbase stations indicated by base station IDs included in the plurality ofMRs. The feature vector unit is further configured to match, based onthe base station IDs, the plurality of MRs obtained by the MR obtainingunit with the engineering parameter of the at least one base stationobtained by the MR obtaining unit, to obtain an associated engineeringparameter of each of the plurality of MRs, where an associatedengineering parameter of any MR includes an engineering parameter of abase station indicated by each base station ID in the any MR, andobtain, based on the associated engineering parameter and the parameterinformation of each of the plurality of MRs obtained by the MR obtainingunit, the feature vector corresponding to each of the plurality of MRs,where any feature vector includes an associated engineering parameterand parameter information of one MR.

In a possible implementation of the seventh aspect, the regressionprocessing unit is further configured to obtain, based on the locationinformation in each of the plurality of MRs obtained by the MR obtainingunit and the feature vector that corresponds to each of the plurality ofMRs and that is obtained by the feature vector unit, a training setcorresponding to each of the plurality of MRs, where any training setincludes a feature vector and location information that correspond toone MR, and input, into the machine learning model for training, thetraining set corresponding to each of the plurality of MRs, to obtainthe single-point positioning model.

In a possible implementation of the seventh aspect, the emissionprobability calculation unit is further configured to input, into thesingle-point positioning model obtained by the regression processingunit, the location information in each of the plurality of MRs obtainedby the MR obtaining unit and the feature vector that corresponds to eachof the plurality of MRs and that is obtained by the feature vector unit,to obtain a mapping relationship, where the mapping relationship is usedto indicate a correspondence between a feature vector and locationinformation, and calculate, based on the mapping relationship, theemission probability of the feature vector corresponding to each of theplurality of MRs.

In a possible implementation of the seventh aspect, the transitionprobability calculation unit includes a preprocessing subunit and atransition probability calculation subunit. The preprocessing subunit isconfigured to process the plurality of pieces of track data obtained bythe track obtaining unit, to obtain at least one combination sequence ofeach of the plurality of pieces of track data, where the combinationsequence includes any two pieces of location information in one piece oftrack data and a time interval between the any two pieces of locationinformation. The transition probability calculation subunit isconfigured to obtain, based on a first preset condition and the at leastone combination sequence that is of each of the plurality of pieces oftrack data and that is obtained by the preprocessing subunit, atransition probability corresponding to the first preset condition,where the first preset condition is any one of a plurality of presetconditions, each of the plurality of preset conditions includes a presettime interval and preset location information, the preset time intervalcorresponds to the time interval T, and the preset location informationcorresponds to the piece of location information.

In a possible implementation of the seventh aspect, the transitionprobability calculation subunit is further configured to determinecombination sequences that include a preset time interval and presetlocation information in the first preset condition and that are in allcombination sequences that are included in the plurality of pieces oftrack data and that are obtained by the preprocessing subunit, andcollect statistics about the combination sequences that include thepreset time interval and the preset location information in the presetcondition, and calculate the transition probability corresponding to thefirst preset condition.

According to an eighth aspect, this application provides a sequencepositioning system, where the system includes a positioning apparatus,the apparatus for calculating an emission probability according to anyone of the fifth aspect or the possible implementations of the fifthaspect, and the apparatus for calculating a transition probabilityaccording to any one of the sixth aspect or the possible implementationsof the sixth aspect. The positioning apparatus includes a target MRobtaining module, a target feature vector module, and a track predictionmodule. The target MR module is configured to obtain a plurality oftarget MRs of a target terminal in a target region and an engineeringparameter of at least one base station in the target region, where thetarget region is a predetermined geographical region, and each of theplurality of target MRs includes parameter information. The targetfeature vector module is configured to obtain, based on the parameterinformation in each of the plurality of target MRs and the engineeringparameter of the at least one base station that are obtained by thetarget MR module, a target feature vector corresponding to each of theplurality of target MRs. The track prediction module is configured toobtain a movement track of the target terminal based on the targetfeature vector that corresponds to each of the plurality of target MRsand that is obtained by the target feature vector module. The apparatusfor calculating an emission probability inputs an emission probabilityinto the track prediction module, and the apparatus for calculating atransition probability inputs a transition probability into the trackprediction module.

According to a ninth aspect, this application provides an apparatus forcalculating an emission probability, where the apparatus for calculatingan emission probability includes a memory and a processor. The memory isconfigured to store a programmable instruction. The processor may invokethe programmable instruction stored in the memory, to implement themethod according to any one of the first aspect or the possibleimplementations of the first aspect.

According to a tenth aspect, this application provides an apparatus forcalculating a transition probability, where the apparatus forcalculating a transition probability includes a memory and a processor.The memory is configured to store a programmable instruction. Theprocessor may invoke the programmable instruction stored in the memory,to implement the method according to any one of the second aspect or thepossible implementations of the second aspect.

According to an eleventh aspect, this application provides a sequencepositioning apparatus, where the sequence positioning apparatus includesa memory and a processor. The memory is configured to store aprogrammable instruction. The processor may invoke the programmableinstruction stored in the memory, to implement the method according toany one of the third aspect, the fourth aspect, or the possibleimplementations of the fourth aspect.

According to a twelfth aspect, this application provides a computerreadable storage medium, including an instruction. When the instructionruns on a computer, the computer is enabled to perform the methodaccording to any one of the first aspect or the possible implementationsof the first aspect, according to any one of the second aspect or thepossible implementations of the second aspect, or according to any oneof the third aspect, the fourth aspect, or the possible implementationsof the fourth aspect.

According to a thirteenth aspect, this application provides a computerprogram product including an instruction. When the instruction runs on acomputer, the computer is enabled to perform the method according to anyone of the first aspect or the possible implementations of the firstaspect, according to any one of the second aspect or the possibleimplementations of the second aspect, or according to any one of thethird aspect, the fourth aspect, or the possible implementations of thefourth aspect.

According to a fourteenth aspect, this application provides a sequencepositioning system, where the sequence positioning system includes theapparatus for calculating an emission probability according to the ninthaspect, the apparatus for calculating a transition probability accordingto the tenth aspect, and a sequence positioning apparatus. The sequencepositioning apparatus includes a processor and a memory. The memory isconfigured to store a programmable instruction. The processor invokesthe programmable instruction stored in the memory, to perform thefollowing operations obtaining a plurality of target MRs of a targetterminal in a target region and an engineering parameter of at least onebase station in the target region, where the target region is apredetermined geographical region, and each of the plurality of targetMRs includes parameter information, obtaining, based on the parameterinformation in each of the plurality of target MRs and the engineeringparameter of the at least one base station, a target feature vectorcorresponding to each of the plurality of target MRs, and inputting,into a sequence positioning model, the target feature vectorcorresponding to each of the plurality of target MRs, to obtain amovement track of the target terminal.

According to the sequence positioning method provided in thisapplication, an emission probability obtained based on feature vectorsobtained based on a plurality of pieces of parameter information in MRsand engineering parameters of corresponding base stations can expressmore complex observed information, thereby further improving accuracyand reliability of a movement track recovered/predicted through sequencepositioning. Alternatively, a transition probability obtained using realtrack data from a third party is used for sequence positioning such thatsmoothness of a recovered/predicted movement track can be improved, andthe obtained movement track is more reliable.

BRIEF DESCRIPTION OF DRAWINGS

FIG. 1 is a schematic structural diagram of a sequence positioningsystem according to this application.

FIG. 2 is a schematic diagram of an application scenario of a sequencepositioning system according to this application.

FIG. 3 is a flowchart of a method for obtaining an emission probabilityaccording to this application.

FIG. 4 is a schematic diagram of calculating an emission probabilityaccording to this application.

FIG. 5 is a flowchart of a method for obtaining a transition probabilityaccording to this application.

FIG. 6 is a schematic diagram of a map matching and interpolation methodaccording to this application.

FIG. 7 is a schematic diagram of a method for calculating a transitionprobability in an offline index manner according to this application.

FIG. 8 is a schematic diagram of a method for calculating a transitionprobability in an online index manner according to this application.

FIG. 9 is a flowchart of a sequence positioning method according to thisapplication.

FIG. 10 is a schematic diagram of recovering a track based on a sequencepositioning method according to this application.

FIG. 11 is a schematic diagram of a particle-filtering-based sequencepositioning method according to this application.

FIG. 12 is a schematic diagram of an apparatus for calculating anemission probability according to this application.

FIG. 13 is a schematic diagram of an apparatus for calculating atransition probability according to this application.

FIG. 14 is a schematic diagram of a sequence positioning apparatusaccording to this application.

FIG. 15 is a schematic diagram of a device for calculating an emissionprobability and/or a transition probability according to thisapplication.

FIG. 16 is an experiment setting and a result of an actual testingexperiment according to this application.

DESCRIPTION OF EMBODIMENTS

The following describes the technical solutions of the embodiments ofthis application with reference to the accompanying drawings.

An embodiment of this application describes a positioning system. Thesystem is configured to position a telecommunication user to recover amovement track of the telecommunication user. As shown in FIG. 1, thepositioning system includes an apparatus for calculating an emissionprobability, an apparatus for calculating a transition probability, anda sequence positioning apparatus. The apparatus for calculating anemission probability, the apparatus for calculating a transitionprobability, and the sequence positioning apparatus perform datacommunication with each other using a data link. The apparatus forcalculating an emission probability is configured to calculate anemission probability used for sequence positioning, where input is MRdata with a location label, and output is an emission probability. Theapparatus for calculating a transition probability is configured tocalculate a transition probability used for sequence positioning, whereinput is movement track data, and output is a transition probability.The sequence positioning apparatus is configured to recover a movementtrack of a to-be-positioned terminal/device based on the emissionprobability, the transition probability, and MR data of theto-be-positioned terminal/device, where input is a string of MRs(without location information) of the to-be-positioned target terminal,and output is the movement track of the to-be-positioned targetterminal. It should be noted that the sequence positioning apparatus maybe alternatively used for single-point positioning, that is, input isone MR, and output is one corresponding location. The following furtherdescribes specific structures and functions of the apparatus forcalculating an emission probability, the apparatus for calculating atransition probability, and the sequence positioning apparatus withreference to the accompanying drawings. Details are not describedherein. It should be noted that the apparatus for calculating anemission probability, the apparatus for calculating a transitionprobability, and the sequence positioning apparatus may alternativelyform an integral device. The apparatus for calculating an emissionprobability is an emission probability calculation module of theintegral device, the apparatus for calculating a transition probabilityis a transition probability calculation module of the integral device,and the sequence positioning apparatus is a sequence positioning moduleof the integral device. Functions of each module are the same asfunctions of a corresponding apparatus, and data may be transmittedbetween the modules. Optionally, functions implemented by each of theemission probability calculation module, the transition probabilitycalculation module, and the sequence positioning module or implementedby the integral device formed by the foregoing three function modulesare implemented using software or software and hardware.

Usually, the positioning system may be deployed on a big data analyticsplatform. When daily MRs are stored on the platform, the MRs are firstinput into the positioning system. The positioning system extractsfeatures based on the MRs, predicts, using a model obtained throughoffline training, a latitude and longitude location recorded in each MR,and adds the latitude and longitude location into the MR. The MR withthe latitude and longitude location may be used for further analysis andmodeling.

An embodiment of this application describes an application scenario. Asshown in FIG. 2, in this application scenario, the positioning systemdescribed in the foregoing embodiment may be used as a component of abig data analytics platform of an operator, to hourly or daily input,into the positioning system, MRs uploaded by a mobile device to apipeline of the operator. The positioning system obtains correspondinglocation information for each MR that is input into the positioningsystem, and adds the corresponding location information into the MR.Subsequently, these MRs into which location information has been addedmay be used by the operator to perform user profiling, trafficprediction, outdoor advertisement placement policy optimization, and thelike.

An embodiment of this application describes a method for obtaining anemission probability. As shown in FIG. 3, the method includes thefollowing steps.

S101. Obtain a plurality of MRs of a terminal in a target region and anengineering parameter of a base station in the target region. The targetregion is a specific geographical region such as a suburb, an urbanregion, a city, or a rural region, and an area size, an administrativeregion, and a geographical location are not limited. Each MR includeslocation information and parameter information, and the locationinformation is used to label a location of a corresponding terminal inthe target region.

The parameter information includes an environment parameter. Theenvironment parameter is used to indicate a real environment in which acorresponding terminal generates an MR, for example, at least one oftime period information, weather information, and event information. Theenvironment parameter is used as a feature, and different emissionprobabilities are obtained based on different environments such thatpositioning in different environments can be more accurately supported.In an embodiment, a peak time period and a non-peak time period are usedas examples. An environment parameter corresponding to the peak timeperiod is represented by 1, and an environment parameter correspondingto the non-peak time period is represented by 0. Positioning a terminalin the target region in the peak time period using an emissionprobability obtained based on an MR with the environment parameter 1 ismore accurate. Similarly, positioning a terminal in the target region inthe non-peak time period using an emission probability obtained based onan MR with the environment parameter 0 is more accurate.

S102. Obtain, based on the parameter information and the engineeringparameter, a feature vector corresponding to each MR. Specifically,matching is performed between the MRs and the engineering parameter ofthe base station based on base station IDs in the parameter information,to obtain an associated engineering parameter of each MR. The associatedengineering parameter of each MR and the information parameter in the MRare combined to generate the feature vector corresponding to the MR. Inspecific implementation, an information parameter in an MR may includeone or more base station IDs. This also indicates that a terminalcorresponding to the MR is connected to one or more base stations at asame time. When parameter information in an MR terminal includes aplurality of base station IDs, an association engineering parameter ofthe MR is a set of engineering parameters of base stations indicated bythe plurality of base station IDs.

S103. Process the location information and the feature vector using amachine learning model, to obtain a single-point positioning model.Specifically, the location information in each MR and the feature vectorcorresponding to the MR constitute a training set, and the training setcorresponding to each MR is input to the machine learning model fortraining, to obtain the single-point positioning model. Optionally, thesingle-point positioning model may be directly used to position ato-be-positioned terminal in the target region, where input of thesingle-point positioning model is a feature vector including parameterinformation in an MR of the to-be-positioned terminal and theengineering parameter of the base station, and output is locationinformation of the to-be-positioned terminal. Optionally, the machinelearning model is a regression model such as linear regression or arandom forest.

S104. Calculate an emission probability based on the single-pointpositioning model, the location information, and the feature vector. Theemission probability includes at least one emission probability value,and the emission probability value is used to indicate a mappingrelationship in which a feature vector used as an observed valuecorresponds to a piece of location information used as a hidden value.Specifically, the location information in each MR and the feature vectorcorresponding to the MR are input into the single-point positioningmodel to obtain a mapping relationship, where the mapping relationshipis used to indicate a correspondence between a feature vector andlocation information, and the emission probability of the feature vectorcorresponding to each MR is calculated based on the mappingrelationship. It should be noted that the location information and thefeature vector that are used in S104 and the location information andthe feature vector that may be used in S101 to S103 are not necessarilyobtained based on a same MR. A reason lies in that a large quantity ofMRs need to be obtained, and using a same MR avoids implementation of astep of obtaining data again. In addition, in terms of result, when anMR base is large enough, whether to use different MRs has relativelysmall impact on a result.

A possible implementation of calculating an emission probability is asfollows.

A single-point positioning model is trained, and then model space of thesingle-point positioning model is used to calculate an emissionprobability. Specifically, the following steps are included.

First, MRs of a plurality of mobile terminals in a preset geographicalregion are obtained. The MRs each include a location label, for example,global positioning system (GPS) information carried in the MR. Inaddition, some other data in a telecommunications network is obtained,for example, an engineering parameter of a base station. The engineeringparameter mainly includes information such as a base station ID, alatitude and longitude location, an antenna height, and an antennaazimuth.

Then, a positioning-related feature is extracted, as a feature vector ofa corresponding MR, from the obtained data using a feature engineeringmethod. The feature vector may include an engineering parameter of aconnected base station, an engineering parameter of a base station in aneighboring cell, signal strength of a connection, and the like.Specifically, matching is performed between the MR that carries the GPSinformation and the engineering parameter of the base station based on abase station ID, to find corresponding parameter information in theengineering parameter for each base station in the MR. Further, somesimple feature engineering parameters are added into data obtained afterthe matching, for example, a quantity of connected base stations in eachMR, where different base stations are at different latitude andlongitude locations, or a quantity of sectors, where a plurality ofsectors may be at a same latitude and longitude location. In this way, afeature vector may be created for each MR, and a feature vector and alocation label corresponding to a same MR form a training setcorresponding to the MR, to train a single-point positioning model.

Table 1 provides some telecommunication features for training apositioning model, including some original fields in the MR and somefields in the engineering parameter of the base station. Features with *indicate that these fields correspond to a connected base station and abase station in a neighboring cell that correspond to a same MR.Therefore, a same field appears in a feature vector a plurality oftimes, and corresponds to different base stations.

TABLE 1 List of features used in a positioning model Feature nameDescription RNCID* ID of an radio network controller (RNC) deviceCellID* Cell ID RSCP* Received signal code power Ec/No* Signal-to-noiseratio RSSI* Received signal strength indicator Antenna height* Antennaheight Antenna azimuth* Antenna orientation Mechanical downtilt angle*Mechanical downtilt angle Electrical downtilt angle* Electrical downtiltangle Sector latitude* Latitude of a location of an antenna Sectorlongitude* Longitude of a location of an antenna Base station type* Basestation type (a macro base station or an indoor distributed basestation) Base station manufacturer* Base station device manufacturer(Huawei, Nokia Siemens Networks, or the like) Quantity of sectors towhich a Quantity of connected sectors in the MR device is connectedQuantity of base stations to Quantity of connected sectors at which adevice is connected different locations

Further, environment information is extracted from the MR as anenvironment parameter, for example, weather information (a sunny day, arainy day, a snowy day, or the like), a time period (a peak time period,a non-peak time period, a work day, a weekend, or an official holiday),and event information (a sports meeting, a concert, a nationalcelebration, and the like). The environment parameter and thetelecommunication feature in Table 1 form a feature vector, and thefeature vector and a corresponding location label form a training set.

Next, all training sets obtained in the foregoing step are input to amachine learning regression model for training, to obtain acorresponding model, namely, the single-point positioning model. Theremay be a plurality of types of machine learning regression models suchas linear regression and a random forest. Usually, for training of asingle-point positioning model in a relatively large region, the regionis divided into blocks, and a single-point positioning model is trainedfor each block. In this way, different features in different regions canbe learned, for example, two models are trained for an urban region anda suburb.

Finally, the feature vector obtained in the foregoing step or a featuresequence obtained based on another MR sample with a location label isused as an observed value, and the location label is used as a hiddenstate. The observed value and the hidden state are input into thesingle-point positioning model obtained in the foregoing step. In thiscase, model space of the single-point positioning model may be analyzedto obtain a correspondence between a location label and a feature vectorin order to obtain P (feature vectorilocation).

Model space of different models corresponds to different calculationmanners. The following uses a random forest as an example to describe amodel space analysis method and an emission probability calculationmanner. Details are described as follows.

After a sample (including a feature vector and a location label) isinput to a random forest, a feature value of the sample and a splittingfeature value of a decision node are continuously compared, to select aleft child node or a right child node, until a leaf node is finallyselected. Therefore, each leaf node in the random forest may beconsidered as a series of feature vectors (which are obtained usingsplitting features of a series of decision nodes), and one leaf node isconsidered as one observed value. In this case, an emission probabilityis changed to a probability P (leaf nodellabel) of obtaining a leaf nodeusing a given label. As shown in FIG. 4, labeled samples are input intoa trained tree model, and a corresponding leaf node in the tree can befound for each labeled sample (as shown in a third part in FIG. 4). Inthis way, an emission probability value may be obtained by dividing atotal quantity of labeled samples with a same label by a quantity of thelabeled samples falling on the leaf node. For example, there are 10 dotsamples in total, and only one dot sample falls on a leaf node on therightmost side of the third picture in FIG. 4. In this case, an emissionprobability value is 1/10. This indicates that a degree of matchingbetween a location of a labeled sample and an observed value (aprobability that a similar observed value may be obtained at thelocation). A higher matching degree indicates that a predicted locationis more accurate.

An embodiment of this application describes a method for obtaining atransition probability. As shown in FIG. 5, the method includes thefollowing steps.

S201. Obtain a plurality of pieces of track data of one or moreterminals in a target region, where the target region is a specificgeographical region such as a suburb, an urban region, a city, or arural region, and an area size, an administrative region, and ageographical location are not limited. Each piece of track data includesat least two pieces of location information. The location information isused to label a location of a terminal in the target region. Each pieceof location information corresponds to a time stamp. The time stamp isused to indicate a moment at which the terminal generates correspondinglocation information. In specific implementation, the track data may beobtained from a third-party platform, for example, Didi Chuxing or atraffic data publishing platform.

Optionally, the obtaining a plurality of pieces of track data of one ormore terminals in a target region includes obtaining track data of theterminal in the target region in a peak traffic time period, orobtaining track data of the one or more terminals in the target regionin a non-peak traffic time period, or obtaining track data of the one ormore terminals in a preset time period. Certainly, an optimal effect isachieved by applying a transition probability obtained based on trackdata of the terminal obtained in a time period to sequence positioningin the same time period, and the transition probability may also beapplied to sequence positioning in a time period similar to the timeperiod.

S202. Calculate a transition probability based on the plurality ofpieces of track data, where the transition probability includes at leastone transition probability value, and the transition probability valueis used to indicate a probability that movement is performed from apiece of location information (a start location) to another piece oflocation information (an arrival location) after a time interval T.Specifically, the obtained plurality of pieces of track data areprocessed to obtain a combination sequence of each piece of track data.Any two pieces of location information in one piece of track data and atime interval between the any two pieces of location information form acombination sequence. One piece of track data may have one or morecombination sequences. For two pieces of location information in onecombination sequence, one piece of location information is used as astart location, and the other piece of location information is used asan arrival location. In this case, the combination sequence indicatesthat movement is performed from the start location to the arrivallocation after a time interval. In all the obtained combinationsequences, combination sequences including a preset condition areobtained through screening. The preset condition is a preset startlocation and a preset time interval. Different combination sequences areobtained through screening based on different preset conditions. In thecombination sequences that meet the preset condition and that areobtained through screening, the arrival location is used as an object tocount quantities of different arrival locations and calculatecorresponding probability values that the quantities of differentarrival locations occupy in all the combination sequences that meet thepreset condition, namely, transition probability values. A set of allthe calculated probability values is a transition probabilitycorresponding to the preset condition. Optionally, the preset timeinterval in the preset condition may be a time interval or a timeinterval range. For example, the preset time interval is 2 seconds, orthe preset time interval is 2 seconds to 4 seconds, that is, if a timeinterval meets the range of 2 seconds to 4 seconds, the time intervalmeets the preset time interval in the preset condition.

Optionally, before the transition probability is calculated based on theplurality of pieces of track data, defective track data is removed fromthe plurality of pieces of track data. The defective track data is trackdata in which location information deviates from a road in the targetregion by a distance greater than a threshold, or is track data in whicha distance between two pieces of adjacent location information isgreater than a threshold. The plurality of pieces of track data obtainedafter the defective track data is removed are used to calculate thetransition probability. This can improve reliability of the transitionprobability or smoothness of transition between two adjacent locations.

Optionally, before the transition probability is calculated based on theplurality of pieces of track data, sparse track data in the track datais obtained through interpolation for densification. The sparse trackdata is track data in which a distance between any two pieces ofadjacent location information is greater than a third threshold.Interpolation means adding one or more pieces of location informationbetween adjacent pieces of location information based on map informationand track data such that the location information in the track data isdense. Specifically, the location information may be added based on atime interval. For example, a track includes only two locations, and atime interval between the two locations is 6 seconds. To obtain a timeinterval of 3 seconds, one location is inserted between the twolocations such that a time interval between locations in the track maybe 3 seconds. Based on the foregoing example, to obtain a time intervalof 1 second, five locations are inserted between the two locations, thatis, one location is inserted every 1 second such that a time intervalbetween locations in the track may be 1 second. Specific geographiclocation information of the inserted location may be relativelyaccurately determined based on map information and the track.

Optionally, the plurality of pieces of track data each include anenvironment parameter indicating an environment in which a correspondingterminal moves to generate a corresponding track, for example, at leastone of time period information, weather information, and eventinformation. The track data can be classified based on the environmentparameter. Track data including a same environment parameter is obtainedfrom existing tracks including different environment parameters, forexample, track data in a peak time period or track data during raining.Different transition probabilities can be obtained based on track dataincluding different environment parameters, for example, an obtainedtransition probability corresponding to a raining environment is used toposition a terminal in the target region during raining. The method forobtaining a transition probability described in this embodiment of thisapplication is to use a transition concept to apply a motion patternlearned from real track data to calculating the transition probability.

A possible implementation of calculating a transition probability is asfollows.

First, a batch of third-party track data in a to-be-positioned region isobtained. Then, a track with a relatively large deviation is removedfrom the data. A large deviation is mainly reflected in that a point inthe track is relatively far from a road or a point that frequentlyappears in the track immediately jumps to a far place. Subsequently,less dense track data is densified using a map matching andinterpolation method such that a transition probability at a relativelyfine granularity (a time interval between two adjacent points in thetrack is as small as possible) can be obtained. Finally, track-pointcoordinates need to be discretized, and the entire to-be-positionedregion is evenly divided into rectangular grids (a grid size isapproximately 20 meters (m) * 20 m) such that each coordinate canuniquely correspond to one grid ID.

A transition probability calculation process may be divided into twoprocesses track densification and transition probability learning.

The track densification process is to learn a transition probabilitycorresponding to any time interval. Specifically, first, each track ismapped to a road network using a map matching algorithm such that a roadthrough which each track passes can be estimated. Then, interpolation isevenly performed along the road through which the track passes such thata time interval between two adjacent points after the interpolation is1s. In this way, the transition probability corresponding to any timeinterval at a granularity of second can be learned.

FIG. 6 shows a method for implementing map matching and interpolation.There are a plurality of map matching methods. For example, a mapmatching method for a track with a low sampling frequency is used. Amapping probability from an original track point to a nearby road and atransition probability between roads are calculated, to obtain a roadsequence with a maximum probability. After a matched path is obtained,interpolation is evenly performed between adjacent points in the track,until a time interval between two adjacent points is equal to 1s .

The transition probability learning process is mainly to learn, from atrack, a transition probability from each location to another location,and there are many specific learning manners.

An embodiment of this application describes a method for learning atransition probability in an offline index manner. As shown in FIG. 7,the manner is divided into two parts. An upper part is offline indexestablishment, and a lower part is online query.

A total of three steps are required during offline index establishment.In a first step, track data is processed into data in a form of a tablein FIG. 7. The table includes a total of three columns (a track ID, atime stamp, and a grid ID), and each row represents a record of a trackpoint. Next, in a second step, triplets (Δt, i, j) are extracted fromthe table, where At is a difference between time stamps corresponding totwo records, and i and j are respectively grid IDs corresponding to thetwo records. Every two of records corresponding to a same track ID canbe used to generate a triplet, and this indicates that movement can beperformed from a grid i to a grid j within the time At. In anembodiment, only records meeting Δt<60s need to be extracted. In a thirdstep, statistics about the triplets generated in the second step arecollected, to obtain a transition probability matrix. For example, for aprobability of arriving at another grid from a grid 1 within 1s, onlyall triplets (1, 1, j) meeting Δt=1 and i=1 need to be found, and then atransition probability vector may be obtained by collecting statisticsabout frequencies that different j appears, namely, a transitionprobability that meets the condition Δt=1 and i=1. The transitionprobability matrix (a same transition time interval) may be obtainedbased on different start grids i, and then different transitionprobability matrices may be obtained based on different transition timeintervals. In addition, for more in line with reality, transitionprobabilities in a peak time period and a non-peak time period aredifferentiated. Track data in the peak time period (for example, 7:00 to9:00 or 17:00 to 19:00) is used to generate a transition matrix in thepeak time period, and track data in another time period is used togenerate a transition matrix in the non-peak time period.

The online query process is mainly as follows. During sequencepositioning, under a condition of a given transition time interval and agiven start grid, a probability distribution vector of arriving atanother grid is obtained. First, a corresponding offline index isselected based on whether a current time is a peak time period. Then, acorresponding transition probability matrix is selected based on a timeinterval Δt. Finally, a corresponding row in the transition probabilitymatrix is found based on a start grid i, namely, a required transitionprobability vector.

An embodiment of this application describes a method for calculating atransition probability in an online index manner. As shown in FIG. 8,the manner may also be divided into three steps, and the first two stepsare the same as those in the offline index. First, track data isprocessed into data in a form of a table of three columns (a track ID, atime stamp, and a grid ID). Then, triplets (Δt, i, j) are extracted fromthe table. Next, RTree is used to establish three-dimensional indexesfor all the extracted triplets (Δt, i, j) (three elements in the tripletrespectively correspond to three dimensions of indexes).

During online query, (Range Query) is queried using a range of RTree.Ranges of At and i are given, for example, 1≤Δt≤2 and 1≤i≤1, RTree canreturn all triplets that meet the condition. Subsequently, all the thirdelements j are extracted from the triplets, and transition probabilitydistribution is obtained based on value distribution of j. Differentfrom the offline index, in the online index, a time interval may be setto a range, for example, 1s to 2s specified in the foregoing example.

An embodiment of this application describes a sequence positioningmethod. As shown in FIG. 9, the method includes the following steps.

S301. Obtain a plurality of target MRs of a target terminal in a targetregion and an engineering parameter of a base station in the targetregion, where each target MR includes parameter information, and theparameter information includes an environment parameter. For details,refer to the foregoing descriptions of a corresponding embodiment.

S302. Obtain a target feature vector based on the parameter informationin the target MR and the engineering parameter of the base station,where each target MR corresponds to a target feature vector, and thetarget feature vector is used as an observed value, and is used to beinput into a sequence positioning model to obtain a corresponding hiddenlocation.

S303. Input the obtained target feature vector into the sequencepositioning model, to obtain a movement track of the target terminal. Anemission probability and a transition probability applied to thesequence positioning model are calculated using the method for obtainingan emission probability and the method for obtaining a transitionprobability that are described in the foregoing embodiments. Details arenot described herein again. It should be noted that a target region forobtaining the emission probability and the transition probability andthe target region for sequence positioning are a same geographicalregion. Similarly, a time period for obtaining the emission probabilityand the transition probability and a time period for sequencepositioning are also a same time period. In this way, a better effectcan be achieved.

After both the emission probability and the transition probability areobtained, the sequence positioning method can be used to recover a trackof a user. As shown in FIG. 10, same as a method for obtaining a featurevector when the emission probability is calculated, herein, an MR of ato-be-positioned terminal also needs to be processed to generate acorresponding feature vector. A series of feature vectors of the sameto-be-positioned terminal and the previously obtained emissionprobability and transition probability are input into the sequencepositioning method such that the algorithm can be used to predict amovement track of the to-be-positioned terminal based on a featuresequence.

There are a plurality of sequence positioning methods. As shown in FIG.11, an embodiment of this application describes aparticle-filtering-based sequence positioning method. An idea ofparticle filtering is to find a particle sequence with a length T (thelength is the same as a length of a to-be-recovered track) such that thesequence is most consistent with feature vectors corresponding to MRs.

In a first step, particles are initialized in state space to generate aparticle set P={P{circumflex over ( )}((1)), p{circumflex over( )}((2)), . . . , p{circumflex over ( )}((N))}. Each particlecorresponds to a state and an importance weight (x_1{circumflex over( )}((i)), w_1{circumflex over ( )}((i))) (the superscript i indicates asequence number of a particle, and the subscript 1 indicates that theparticle corresponds to the first point in a track). Usually, there arehundreds to thousands of particles. Each initialized particle forms aparticle sequence in a subsequent step through state transition, andrandom initialization is performed on an initial state in a suitablerange (for example, within coverage of hundreds of meters of a connectedbase station). The importance weight is an emission probability p(y|x),namely, a probability of obtaining an observed value using a givenstate. According to the foregoing method for calculating an emissionprobability, a state (equivalent to a label) of a particle is input toobtain a corresponding emission probability value.

In a second step, sampling is performed. Then, a next state is sampledbased on a current state x_j{circumflex over ( )}((i)) of each particleand a time interval Δt_j between two adjacent points in an MR. Herein,the offline index in the foregoing embodiment is used. After Δt_j andx_j{circumflex over ( )}((i)) are input using the foregoing online querymethod, state transition probability distribution p(x_(j+1){circumflexover ( )}((i))|x_j{circumflex over ( )}((i))) is obtained. A state issampled from the distribution as a state x_(j+1){circumflex over( )}((i)) of an i^(th) particle at a (j+1)^(th) moment.

In a third step, decision making is performed. A correspondingimportance weight w_(j+1){circumflex over ( )}((i))=w_j{circumflex over( )}((i))p(y_(j+1)|x_(j+1){circumflex over ( )}((i))) is calculatedbased on x_(j+1){circumflex over ( )}((i)) and w_j{circumflex over( )}((i)). Normalization is performed on importance weights of allparticle sequences such that importance distribution can be obtained.After the second and third steps are completed, lengths of all theparticle sequences in the particle set are increased by 1.

In a fourth step, resampling is performed. If distribution of theimportance weights of all the particle sequences meets a specificcondition, resampling is performed for the particles. Resampling is aprocess in which sampling with replacement is performed. Sampling isperformed based on values of the weights. If a particle sequence has alarger weight, a probability that sampling is performed on the particlesequence is higher (sampling may be performed on the particle sequence aplurality of times). The particle sequences existing before resamplingis performed are replaced with the particle sequences existing afterresampling is performed (quantities of sequences before and aftersampling are the same). If a current particle sequence length is lessthan T, the importance weights of all the particle sequences need to bereset to 1/N.

The second, third, and fourth steps are repeated, until the particlesequence length is equal to T. In this case, a particle sequence with alargest importance weight is output as a predicted track, and oneparticle sequence corresponds to a string of states, namely, a string oflatitude and longitude locations.

An embodiment of this application describes a Viterbi sequencepositioning method. A dynamic planning idea is used in the method. Amatrix V_(t,k) is continuously updated, and the matrix indicates aprobability that final states of the first t sequences are a statesequence k. Each time when V_(t+1,k) is calculated, a maximum value ofV_(t,x)*a_(x,k) needs to be found, where x is a variable, that is, amost suitable state prior to k needs to be found, and a_(x,k) is acalculated transition probability, namely, a probability that movementis performed from a grid x to a grid k. Then, V_(t+1,k)=b_y(k)*max((V)_(t,x)*a_(x,k)), where b represents a calculated emission probability. Inthis way, after all V_matrix values are updated, a maximum value can befound in a row V_(T,k), and then the previous state (a state meeting themaximum value in the foregoing formula) is found through tracing, untila state transition sequence is obtained.

An embodiment of this application describes an apparatus for calculatingan emission probability. As shown in FIG. 12, the apparatus 100 forcalculating an emission probability includes an MR obtaining module 110,a feature vector module 120, a regression processing module 130, and anemission probability calculation module 140. The MR obtaining module 110is configured to obtain a plurality of MRs of a terminal in a targetregion and an engineering parameter of at least one base station in thetarget region, where the target region is a predetermined geographicalregion, each of the plurality of MRs includes location information andparameter information, and the location information is used to indicatea location of a corresponding terminal in the target region. The featurevector module 120 is configured to obtain, based on the parameterinformation in each of the plurality of MRs and the engineeringparameter of the at least one base station that are obtained by the MRobtaining module 110, a feature vector corresponding to each of theplurality of MRs. The regression processing module 130 is configured toobtain a single-point positioning model based on the locationinformation in each of the plurality of MRs obtained by the MR obtainingmodule 110 and the feature vector that corresponds to each of theplurality of MRs and that is obtained by the feature vector module 120.The emission probability calculation module 140 is configured tocalculate, based on the single-point positioning model obtained by theregression processing module 130, the location information in each ofthe plurality of MRs obtained by the MR obtaining module 110, and thefeature vector that corresponds to each of the plurality of MRs and thatis obtained by the feature vector module 120, an emission probability ofthe feature vector corresponding to each of the plurality of MRs, wherethe emission probability includes at least one emission probabilityvalue, and the emission probability value is used to indicate aprobability that a feature vector corresponds to a piece of locationinformation.

Further, the parameter information in each of the plurality of MRsincludes at least one base station ID, the base station ID is used toindicate a base station to which a terminal corresponding to an MRincluding the base station ID is connected, and the at least one basestation includes at least base stations indicated by base station IDsincluded in the plurality of MRs. The feature vector module 120 isfurther configured to match, based on the base station IDs, theplurality of MRs obtained by the MR obtaining module 110 with theengineering parameter of the at least one base station obtained by theMR obtaining module 110, to obtain an associated engineering parameterof each of the plurality of MRs, where an associated engineeringparameter of any MR includes an engineering parameter of a base stationindicated by each base station ID in the any MR, and obtain, based onthe associated engineering parameter and the parameter information ofeach of the plurality of MRs obtained by the MR obtaining module, thefeature vector corresponding to each of the plurality of MRs, where anyfeature vector includes an associated engineering parameter andparameter information of one MR.

Further, the regression processing module 130 is further configured toobtain, based on the location information in each of the plurality ofMRs obtained by the MR obtaining module 110 and the feature vector thatcorresponds to each of the plurality of MRs and that is obtained by thefeature vector module 120, a training set corresponding to each of theplurality of MRs, where any training set includes a feature vector andlocation information that correspond to one MR, and input, into amachine learning model for training, the training set corresponding toeach of the plurality of MRs, to obtain the single-point positioningmodel.

Further, the emission probability calculation module 140 is furtherconfigured to input, into the single-point positioning model obtained bythe regression processing module 130, the location information in eachof the plurality of MRs obtained by the MR obtaining module 110 and thefeature vector that corresponds to each of the plurality of MRs and thatis obtained by the feature vector module 120, to obtain a mappingrelationship, where the mapping relationship is used to indicate acorrespondence between a feature vector and location information, andcalculate, based on the mapping relationship, the emission probabilityof the feature vector corresponding to each of the plurality of MRs.

The apparatus for calculating an emission probability described in thisembodiment is configured to implement the method described in theembodiment corresponding to FIG. 3. For more detailed descriptions,refer to the embodiment corresponding to FIG. 3. Details are notdescribed herein again.

According to the apparatus for calculating an emission probabilityprovided in this embodiment of this application, feature vectorsobtained using a plurality of pieces of parameter information in MRs andengineering parameters of corresponding base stations are used asobserved values, and then a single-point positioning model is trainedusing the feature vectors and location information that correspond tothe MRs such that an emission probability obtained using a spatial modelof the single-point positioning model can express complex observedinformation, and a correspondence between a feature vector (an observedvalue) and location information is more reliable.

An embodiment of this application describes an apparatus for calculatinga transition probability. As shown in FIG. 13, the apparatus 200 forcalculating a transition probability includes a track obtaining module210 and a transition probability calculation module 220. The trackobtaining module 210 is configured to obtain a plurality of pieces oftrack data of a terminal in a target region, where the target region isa predetermined geographical region, each of the plurality of pieces oftrack data includes at least two pieces of location information, thelocation information is used to indicate a location of a correspondingterminal in the target region, and each of a plurality of pieces oflocation information included in the plurality of pieces of track datacorresponds to a time stamp. The transition probability calculationmodule 220 is configured to calculate a transition probability based onthe plurality of pieces of track data obtained by the track obtainingmodule 210, where the transition probability includes at least onetransition probability value, and the transition probability value isused to indicate a probability that movement is performed from a pieceof location information to another piece of location information after atime interval T. Optionally, the plurality of pieces of track data ofthe terminal in the target region in a peak traffic time period or anon-peak traffic time period are obtained.

Optionally, the plurality of pieces of track data each include anenvironment parameter indicating an environment in which a correspondingterminal moves to generate a corresponding track, for example, at leastone of time period information, weather information, and eventinformation. The track data can be classified based on the environmentparameter. Track data including a same environment parameter is obtainedfrom existing tracks including different environment parameters, forexample, track data in a peak time period or track data during raining.Different transition probabilities can be obtained based on track dataincluding different environment parameters, for example, an obtainedtransition probability corresponding to a raining environment is used toposition a terminal in the target region during raining.

Further, the transition probability calculation module 220 includes apreprocessing unit 221 and a transition probability calculation unit222. The preprocessing unit 221 is configured to process the pluralityof pieces of track data obtained by the track obtaining module 210, toobtain at least one combination sequence of each of the plurality ofpieces of track data, where the combination sequence includes any twopieces of location information in one piece of track data and a timeinterval between the any two pieces of location information. Thetransition probability calculation unit 222 is configured to obtain,based on a first preset condition and the at least one combinationsequence that is of each of the plurality of pieces of track data andthat is obtained by the preprocessing unit 221, a transition probabilitycorresponding to the first preset condition, where the first presetcondition is any one of a plurality of preset conditions, each of theplurality of preset conditions includes a preset time interval andpreset location information, the preset time interval corresponds to thetime interval T, and the preset location information corresponds to thepiece of location information. Optionally, the preset time interval is apreset time interval range.

Further, the transition probability calculation unit 222 is furtherconfigured to determine combination sequences that include a preset timeinterval and preset location information in the first preset conditionand that are in all combination sequences that are included in theplurality of pieces of track data and that are obtained by thepreprocessing unit 221, and collect statistics about the combinationsequences that include the preset time interval and the preset locationinformation in the preset condition, and calculate the transitionprobability corresponding to the first preset condition.

Optionally, the apparatus 200 for calculating a transition probabilityfurther includes a first track processing module 230. The first trackprocessing module 230 is configured to remove defective track data fromthe plurality of pieces of track data obtained by the track obtainingmodule 210, where the defective track data is track data in which atleast one piece of location information deviates from a road in thetarget region by a distance greater than a first threshold, or is trackdata in which a distance between two pieces of adjacent locationinformation is greater than a second threshold.

Optionally, the apparatus 200 for calculating a transition probabilityfurther includes a second track processing module 240. The second trackprocessing module 240 is configured to determine sparse track data inthe plurality of pieces of track data obtained by the track obtainingmodule 210, where the sparse track data is track data in which adistance between any two pieces of adjacent location information in theat least two pieces of location information included in the track datais greater than a third threshold, and insert one or more pieces oflocation information between the any two pieces of adjacent locationinformation in the sparse track data based on map information of thetarget region.

The apparatus for calculating a transition probability described in thisembodiment is configured to implement the method described in theembodiment corresponding to FIG. 5. For more detailed descriptions,refer to the embodiment corresponding to FIG. 5. Details are notdescribed herein again.

According to the apparatus for calculating a transition probabilityprovided in this embodiment of this application, a transitionprobability calculated based on movement track data that is of aterminal in a target region and that is provided by a third-partyplatform is used to recover or predict a movement track of a terminal inthe target region such that the movement track is smoother, and trackjumping can effectively be avoided.

An embodiment of this application provides a sequence positioningapparatus. As shown in FIG. 14, the sequence positioning apparatus 300includes an emission probability calculation module 310, a transitionprobability calculation module 320, and a sequence positioning module330. Application parameters of a sequence positioning model 330 includean emission probability and a transition probability. The emissionprobability calculation module 310 is configured to calculate theemission probability. The transition probability calculation module 320is configured to calculate the transition probability. The sequencepositioning module 330 is configured to obtain a movement track of atarget terminal.

Specifically, the emission probability calculation module 310 includes aMR obtaining unit 311, a feature vector unit 312, a regressionprocessing unit 313, and an emission probability calculation unit 314.The MR obtaining unit 311 is configured to obtain a plurality of MRs ofa first terminal in a target region and an engineering parameter of atleast one base station in the target region, where the target region isa predetermined geographical region, each of the plurality of MRsincludes location information and parameter information, and thelocation information is used to indicate a location of a correspondingfirst terminal in the target region. The feature vector unit 312 isconfigured to obtain, based on the parameter information in each of theplurality of MRs and the engineering parameter of the at least one basestation that are obtained by the MR obtaining unit 311, a feature vectorcorresponding to each of the plurality of MRs. The regression processingunit 313 is configured to obtain a single-point positioning model basedon the location information in each of the plurality of MRs obtained bythe MR obtaining unit 311 and the feature vector that corresponds toeach of the plurality of MRs and that is obtained by the feature vectorunit 312. The emission probability calculation unit 314 is configured tocalculate, based on the single-point positioning model obtained by theregression processing unit 313, the parameter information in each of theplurality of MRs obtained by the MR obtaining unit 311, and the featurevector that corresponds to each of the plurality of MRs and that isobtained by the feature vector unit 312, an emission probability of thefeature vector corresponding to each of the plurality of MRs, where theemission probability includes at least one emission probability value,and the emission probability value is used to indicate a probabilitythat a feature vector corresponds to a piece of location information.The emission probability calculation module 310 described in thisembodiment has same functions as the apparatus for calculating anemission probability described in the embodiment corresponding to FIG.12. For detailed descriptions of the emission probability calculationmodule 310, refer to descriptions of the embodiment corresponding toFIG. 12. Details are not described herein again.

The transition probability calculation module 320 includes a trackobtaining unit 321, a first track processing unit 322, a second trackprocessing unit 323, and a transition probability calculation unit 324.The track obtaining unit 321 is configured to obtain a plurality ofpieces of track data of a second terminal in the target region, whereeach of the plurality of pieces of track data includes at least twopieces of location information, the location information is used toindicate a location of a corresponding second terminal in the targetregion, and each of a plurality of pieces of location informationincluded in the plurality of pieces of track data corresponds to a timestamp. The first track processing unit 322 is configured to removedefective track data from the plurality of pieces of track data obtainedby the track obtaining unit 321, where the defective track data is trackdata in which at least one piece of location information deviates from aroad in the target region by a distance greater than a first threshold,or is track data in which a distance between two pieces of adjacentlocation information is greater than a second threshold. The secondtrack processing module 323 is configured to determine sparse track datain the plurality of pieces of track data obtained by the track obtainingunit 321, where the sparse track data is track data in which a distancebetween any two pieces of adjacent location information in the at leasttwo pieces of location information included in the track data is greaterthan a third threshold, and insert one or more pieces of locationinformation between the any two pieces of adjacent location informationin the sparse track data based on map information of the target region.The transition probability calculation unit 324 is configured tocalculate a transition probability based on the plurality of pieces oftrack data processed by the first track processing unit 322 and/or thesecond track processing unit 323, where the transition probabilityincludes at least one transition probability value, and the transitionprobability value is used to indicate a probability that movement isperformed from a piece of location information to another piece oflocation information after a time interval T. Optionally, the pluralityof pieces of track data obtained by the track obtaining unit 321 are notprocessed by the first track processing unit 322 and the second trackprocessing unit 323, and the transition probability calculation unit 324calculates a transition probability based on the plurality of pieces oftrack data obtained by the track obtaining unit 321. The transitionprobability calculation module 320 described in this embodiment has samefunctions as the apparatus for calculating a transition probabilitydescribed in the embodiment corresponding to FIG. 13. For detaileddescriptions of the transition probability calculation module 320, referto descriptions of the embodiment corresponding to FIG. 13. Details arenot described herein again.

The sequence positioning module 330 includes a target MR obtaining unit331, a target feature vector unit 332, and a track prediction unit 333.The target MR unit 331 is configured to obtain a plurality of target MRsof a target terminal in the target region and the engineering parameterof the at least one base station in the target region, where the targetregion is a predetermined geographical region, and each of the pluralityof target MRs includes parameter information. The target feature vectorunit 332 is configured to obtain, based on the parameter information ineach of the plurality of target MRs and the engineering parameter of theat least one base station that are obtained by the target MR unit 331, atarget feature vector corresponding to each of the plurality of targetMRs. The track prediction unit 333 is configured to obtain a movementtrack of the target terminal based on the target feature vector thatcorresponds to each of the plurality of target MRs and that is obtainedby the target feature vector unit 332. According to the sequencepositioning apparatus provided in this embodiment of this application,an emission probability obtained based on feature vectors obtained basedon a plurality of pieces of parameter information in MRs and engineeringparameters of corresponding base stations can express more complexobserved information, thereby further improving accuracy and reliabilityof a movement track recovered/predicted through sequence positioning.Alternatively, a transition probability obtained using real track datafrom a third party is used for sequence positioning such that smoothnessof a recovered/predicted movement track can be improved, and theobtained movement track is more reliable.

An embodiment of this application provides a device. As shown in FIG.15, the device 400 includes a memory 410, a processor 420, aninput/output port 430, and a power supply 440.

The memory 410 is configured to store a programmable instruction.

The processor 420 may invoke the programmable instruction stored in thememory 410, to perform the method for obtaining an emission probabilitydescribed in the embodiment corresponding to FIG. 3 and/or the methodfor obtaining a transition probability described in the embodimentcorresponding to FIG. 5. For a specific method, refer to descriptions ofa corresponding embodiment. Details are not described herein again.

The input/output port 430 is used by the processor 420 to exchange datawith a device or an apparatus outside the device 400. Specifically, theprocessor 420 obtains MR and/or track data from the outside using theinput/output port 430, and outputs a calculation result using theinput/output port 430.

The power supply 440 is configured to supply required power for thedevice 400.

FIG. 16 shows an experiment setting and a result of an actual testingexperiment according to a solution of this application. Compared with acurrent mainstream single-point positioning method in the industry suchas fingerprint positioning, range-based positioning, and other sequencepositioning, in the sequence positioning method based on machinelearning and feature engineering described in the embodiments of thisapplication, precision is greatly improved. In the sequence positioningmethod described in the embodiments of this application, a median oferrors obtained using drive test data may reach 22 meters, and precisionis improved by more than 20%.

Compared with a case in which only single signal strength is consideredin a definition of an observed value in other approaches, in the presentdisclosures, the definition is extended to a combination of features inany dimension.

In other approaches, there are mainly two manners of calculating atransition probability. One manner is to directly perform transitionfrom a current grid to a neighboring grid based on an equal probability.The other manner is to assume an equation of a motion pattern, tocalculate the transition probability according to the equation.According to the method described in the embodiments of thisapplication, a transition probability at each time granularity iscalculated using real data. This is more realistic than other approachesand the probability is at a finer granularity.

Finally, it should be noted that the foregoing embodiments are merelyintended for describing the technical solutions of this applicationother than limiting this application. Although this application isdescribed in detail with reference to the foregoing embodiments, personsof ordinary skill in the art should understand that they may still makemodifications to the technical solutions described in the foregoingembodiments or make equivalent replacements to some or all technicalfeatures thereof, without departing from the scope of the technicalsolutions of the embodiments of this application.

1. A method for obtaining an emission probability for sequencepositioning, comprising: obtaining a plurality of measurement reports(MRs) of a terminal in a target region and an engineering parameter ofat least one base station in the target region, wherein the targetregion is a predetermined geographical region, wherein each of the MRscomprises location information and parameter information, wherein thelocation information indicates a location that is in the target regionand that is of a terminal corresponding to the MRs comprising thelocation information, wherein the parameter information comprises anenvironment parameter, and wherein the environment parameter indicatesan environment in which the terminal corresponding to the MRs comprisingthe environment parameter is located; obtaining a feature vectorcorresponding to each of the MRs based on the parameter information ineach of the MRs and the engineering parameter of the at least one basestation; processing the location information in each of the MRs and thefeature vector corresponding to each of the MRs using a regression modelto obtain a single-point positioning model; and calculating the emissionprobability of the feature vector corresponding to each of the MRs basedon the single-point positioning model, the location information in eachof the MRs, and the feature vector corresponding to each of the MRs,wherein the emission probability comprises an emission probabilityvalue, and wherein the emission probability value indicates aprobability that the feature vector corresponds to a piece of locationinformation.
 2. The method of claim 1, wherein the parameter informationin each of the MRs comprises at least one base station identifier (ID)corresponding to the at least one base station of a plurality of basestations, wherein the at least one base station ID indicates a basestation to which the terminal is connected, and wherein the methodfurther comprises: matching the MRs with the engineering parameter ofthe at least one base station based on the at least one base station IDto obtain an associated engineering parameter of each of the MRs,wherein the associated engineering parameter of each of the MRscomprises the engineering parameter of the base station indicated byeach of the base station IDs; and obtaining the feature vectorcorresponding to each of the MRs based on the associated engineeringparameter and the parameter information of each of the MRs, wherein thefeature vector comprises the associated engineering parameter andparameter information of one of the MRs.
 3. The method of claim 1,wherein processing the location information in each of the MRs and thefeature vector corresponding to each of the MRs to obtain thesingle-point positioning model comprises: obtaining a plurality oftraining sets wherein each of the training sets corresponds to each ofthe MRs based on the location information in each of the MRs and thefeature vector corresponding to each of the MRs, wherein any of thetraining sets comprises the feature vector and the location informationthat correspond to one of the MRs; and inputting the training setcorresponding to each of the MRs to obtain the single-point positioningmodel into a machine learning model for training.
 4. The method of claim1, wherein calculating the emission probability of the feature vectorcorresponding to each of the MRs comprises: inputting the locationinformation in each of the MRs and the feature vector corresponding toeach of the MRs into the single-point positioning model to obtain amapping relationship, wherein the mapping relationship indicates acorrespondence between the feature vector and the location information;and calculating the emission probability of the feature vectorcorresponding to each of the MRs based on the mapping relationship. 5.The method of claim 1, wherein the environment parameter comprises atleast one of time period information, weather information, or eventinformation.
 6. A method for obtaining a transition probability,comprising: obtaining a plurality of pieces of track data of a terminalin a target region from a third-party platform, wherein the targetregion is a predetermined geographical region, wherein each of thepieces of the track data comprises a same environment parameter and atleast two pieces of location information, wherein the environmentparameter indicates an environment in which the terminal is located,wherein the at least two pieces of the location information indicate alocation of the terminal that is in the target region wherein each ofthe at least two pieces of the location information corresponds to atime stamp; and calculating the transition probability based on thepieces of the track data, wherein the transition probability comprises atransition probability value, wherein the transition probability valueindicates a probability that the terminal moves from one of the at leasttwo pieces of the location information to another of the at least twopieces of the location information after a time interval T.
 7. Themethod of claim 6, wherein calculating the transition probability basedon the pieces of the track data comprises: processing the pieces of thetrack data to obtain a combination sequence of each of the pieces of thetrack data, wherein the combination sequence comprises any two of the atleast two pieces of the location information in one of the pieces of thetrack data and a time interval between the any two of the at least twopieces of the location information; and obtaining the transitionprobability corresponding to a first preset condition based on a firstpreset condition and the combination sequence of each of the pieces ofthe track data, wherein the first preset condition is any one of aplurality of preset conditions, wherein each of the preset conditionscomprises a preset time interval and preset location information,wherein the preset time interval corresponds to the time interval T, andwherein the preset location information corresponds to one of the atleast two pieces of the pieces of the location information.
 8. Themethod of claim 7, wherein obtaining, the transition probabilitycorresponding to the first preset condition comprises: determiningcombination sequences that comprise the preset time interval and thepreset location information in the first preset condition and that arein the combination sequences comprised in the pieces of the track data;collecting statistics about the combination sequences that comprise thepreset time interval and the preset location information in the presetcondition; and calculating the transition probability corresponding tothe first preset condition.
 9. The method of claim 6, wherein beforecalculating the transition probability, the method further comprisedremoving defective track data from the pieces of the track data, whereinthe defective track data is the track data in which one of the at leasttwo pieces of the location information deviates from a road in thetarget region by a distance greater than a first threshold or is thetrack data in which a distance between two pieces of adjacent locationinformation is greater than a second threshold.
 10. The method of claim6, wherein before calculating the transition probability based on thepieces of the track data, the method further comprises: determiningsparse track data in the pieces of the track data, wherein the sparsetrack data is the track data in which a distance between any two piecesof adjacent location information in the at least two pieces of thelocation information comprised in the track data is greater than a thirdthreshold; and inserting one or more of the at least two pieces of thelocation information between any two of the pieces of the adjacentlocation information in the sparse track data based on map informationof the target region.
 11. The method of claim 6, wherein obtaining thepieces of the track data of the terminal in the target region comprisesobtaining the pieces of the track data of the terminal in the targetregion in a peak traffic time period or a non-peak traffic time period.12. The method of claim 6, wherein the environment parameter comprisesat least one of time period information, weather information, or eventinformation.
 13. The method of claim 7, wherein the preset time intervalis a preset time interval range.
 14. A sequence positioning method,comprising: obtaining a plurality of target measurement reports (MRs) ofa target terminal in a target region and an engineering parameter of atleast one base station in the target region, wherein the target regionis a predetermined geographical region, wherein each of the target MRscomprises parameter information, wherein the parameter information ineach of the target MRs comprises a target environment parameter, whereinthe target environment parameter indicates an environment in which atarget terminal corresponding to the target MRs comprising the targetenvironment parameter is located; obtaining a target feature vectorcorresponding to each of the target MRs based on the parameterinformation in each of the target MRs and the engineering parameter ofthe at least one base station; and inputting the target feature vectorcorresponding to each of the target MRs to obtain a movement track ofthe target terminal into a sequence positioning model, whereinapplication parameters of the sequence positioning model comprise anemission probability and a transition probability, wherein the emissionprobability is obtained using the following method: obtaining aplurality of MRs of a first terminal in the target region, wherein eachof the MRs of the first terminal comprises first location informationand the parameter information, wherein the first location informationindicates a location that is in the target region and that is of thefirst terminal corresponding to the MRs comprising the first locationinformation, wherein the parameter information comprised in each of theMRs of the first terminal comprises a first environment parameter,wherein the first environment parameter indicates an environment inwhich the first terminal corresponding to the MRs comprising the firstenvironment parameter is located; obtaining a feature vectorcorresponding to each of the MRs of the first terminal based on theparameter information in each of the MRs of the first terminal and theengineering parameter of the at least one base station; processing thefirst location information in each of the MRs of the first terminal andthe feature vector corresponding to each of the MRs of the firstterminal using a machine learning model to obtain a single-pointpositioning model; and calculating the emission probability of thefeature vector corresponding to each of the MRs of the first terminalbased on the single-point positioning model, the first locationinformation in each of the MRs of the first terminal and the featurevector corresponding to each of the MRs of the first terminal, whereinthe emission probability comprises an emission probability value,wherein the emission probability value indicates a probability that thefeature vector corresponds to a piece of first location information, andwherein the machine learning model is a regression model.
 15. Thesequence positioning method of claim 14, wherein the parameterinformation in each of the MRs of the first terminal comprises at leastone base station identifier (ID), wherein the at least one base stationID indicates a base station to which the first terminal is connected,and wherein the method further comprises: matching the MRs of the firstterminal with the engineering parameter of the at least one base stationbased on the at least one base station ID to obtain an associatedengineering parameter of each of the MRs of the first terminal, whereinthe associated engineering parameter of each of the MRs of the firstterminal comprises the engineering parameter of the base stationindicated by each of the base station IDs; and obtaining the featurevector corresponding to each of the MRs of the first terminal based onthe associated engineering parameter and the parameter information ofeach of the MRs of the first terminal, wherein the feature vectorcomprises the associated engineering parameter and parameter informationof one of the MRs of the first terminal.
 16. The sequence positioningmethod of claim 14, wherein processing the first location information ineach of the MRs of the first terminal and the feature vectorcorresponding to each of the MRs of the first terminal to obtain thesingle-point positioning model comprises: obtaining a plurality oftraining sets corresponding to each of the MRs of the first terminalbased on the first location information in each of the MRs of the firstterminal and the feature vector corresponding to each of the MRs of thefirst terminal, wherein any of the training sets comprise the featurevector and the first location information that correspond to one of theMRs of the first terminal; and inputting the training set correspondingto each of the MRs of the first terminal to obtain the single-pointpositioning model into the machine learning model for training.
 17. Thesequence positioning method of claim 14, wherein calculating theemission probability of the feature vector corresponding to each of theMRs of the first terminal comprises: inputting the first locationinformation in each of the MRs of the first terminal and the featurevector corresponding to each of the MRs of the first terminal into thesingle-point positioning model to obtain a mapping relationship, whereinthe mapping relationship indicates a correspondence between the featurevector and the first location information; and calculating the emissionprobability of the feature vector corresponding to each of the MRs ofthe first terminal based on the mapping relationship.
 18. The sequencepositioning method of claim 14, wherein the first environment parametercomprises at least one of time period information, weather information,or event information.
 19. The sequence positioning method of claim 14,wherein the following method obtains the transition probability:obtaining a pieces of track data of a second terminal in the targetregion from a third-party platform, wherein each of the pieces of thetrack data comprises a same second environment parameter and at leasttwo pieces of location information, wherein the second environmentparameter indicates an environment in which the second terminalcorresponding to the track data comprising the second environmentparameter is located, wherein the at least two pieces of the secondlocation information indicate the location of the terminal that is inthe target region wherein each of the pieces of the second locationinformation in a plurality of pieces of location information comprisedin the pieces of the track data of the second terminal corresponds to atime stamp; and calculating the transition probability based on thepieces of the track data of the second terminal, wherein the transitionprobability comprises a transition probability value, wherein thetransition probability value indicates a probability that the secondterminal moves from one of the pieces of the second location informationto another of the pieces of the second location information after a timeinterval T.
 20. The sequence positioning method of claim 19, whereincalculating the transition probability comprises: processing the piecesof the track data of the second terminal to obtain a combinationsequence of each of the pieces of the track data of the second terminal,wherein the combination sequence comprises any two pieces of secondlocation information in one of the pieces of the track data of thesecond terminal and a time interval between any two of the pieces of thesecond location information; and obtaining the transition probabilitycorresponding to a first preset condition based on a first presetcondition and the combination sequence of each of the pieces of thetrack data of the second terminal, wherein the first preset condition isany one of a plurality of preset conditions, wherein each of the presetconditions comprises a preset time interval and preset second locationinformation, wherein the preset time interval corresponds to the timeinterval T, and wherein the preset second location informationcorresponds to the piece of second location information.
 21. Thesequence positioning method of claim 20, wherein obtaining thetransition probability corresponding to the first preset conditioncomprises: determining combination sequences that comprise the presettime interval and the preset second location information in the firstpreset condition and that are in all of the combination sequencescomprised in the pieces of the track data of the second terminal; andcollecting statistics about the combination sequences that comprise thepreset time interval and the preset second location information in thepreset condition; and calculating the transition probabilitycorresponding to the first preset condition.
 22. The sequencepositioning method of claim 19, wherein the second environment parametercomprises at least one of time period information, weather information,or event information.
 23. The sequence positioning method of claim 14,wherein the target environment parameter comprises at least one of timeperiod information, weather information, or event information.
 24. Anapparatus for calculating an emission probability, comprising: aprocessor; and a memory coupled to the processor and storinginstructions that, when executed by the processor, cause the apparatusto be configured to: obtain a plurality of measurement reports (MRs) ofa terminal in a target region and an engineering parameter of at leastone base station in the target region, wherein the target region is apredetermined geographical region, wherein each of the MRs compriseslocation information and parameter information, wherein the locationinformation indicates a location that is in the target region and thatis of a terminal corresponding to the MRs comprising the locationinformation, wherein the parameter information comprises an environmentparameter, and wherein the environment parameter indicates anenvironment in which the terminal corresponding to the MRs comprisingthe environment parameter is located; obtain a feature vectorcorresponding to each of the MRs based on the parameter information ineach of the MRs and the engineering parameter of the base station;process the location information in each of the MRs and the featurevector corresponding to each of the MRs using a regression model toobtain a single-point positioning model; and calculate, based on thesingle-point positioning model, the location information in each of theMRs and the feature vector corresponding to each of the MRs, theemission probability of the feature vector corresponding to each of theMRs, wherein the emission probability comprises an emission probabilityvalue, and wherein the emission probability value indicates aprobability that the feature vector corresponds to a piece of locationinformation.
 25. An apparatus for calculating a transition probability,comprising: a processor; and a memory coupled to the processor andstoring instructions that, when executed by the processor, cause theapparatus to be configured to: obtain a plurality of pieces of trackdata of a terminal in a target region from a third-party platform,wherein the target region is a predetermined geographical region,wherein each of the pieces of the track data comprises an environmentparameter and at least two pieces of location information, wherein theenvironment parameter indicates an environment in which the terminal islocated, wherein the at least two pieces of location informationindicate a location of the terminal that is in the target region,wherein each of the at least two pieces of the location informationcorresponds to a time stamp; and calculate the transition probabilitybased on the pieces of the track data, wherein the transitionprobability comprises a transition probability value, and wherein thetransition probability value indicates a probability that the terminalmoves from one of the pieces of the location information to another ofthe pieces of the location information after a time interval T.
 26. Asequence positioning apparatus, comprising: a processor; and a memorycoupled to the processor and storing instructions that, when executed bythe processor, cause the sequence positioning apparatus to be configuredto: obtain a plurality of target measurement reports (MRs) of a targetterminal in a target region and an engineering parameter of at least onebase station in the target region, wherein the target region is apredetermined geographical region, wherein each of the target MRscomprises parameter information, wherein the parameter informationcomprised in each of the target MRs comprises a target environmentparameter, and the target environment parameter indicates an environmentin which a target terminal corresponding to the target MR comprising thetarget environment parameter is located; obtain a target feature vectorcorresponding to each of the target MRs based on the parameterinformation in each of the target MRs and the engineering parameter ofthe base station; and input the target feature vector corresponding toeach of the target MRs to obtain a movement track of the target terminalinto a sequence positioning model, wherein application parameters of thesequence positioning model comprise an emission probability and atransition probability, wherein the emission probability is obtained byusing the following method: obtaining a plurality of MRs of a firstterminal in the target region, wherein each of the MRs of the firstterminal comprises first location information and the parameterinformation, the first location information indicates a location that isin the target region and that is of the first terminal corresponding tothe MRs comprising the first location information, the parameterinformation comprised in each of the MRs of the first terminal comprisesa first environment parameter, wherein the first environment parameterindicates the environment in which the first terminal corresponding tothe MRs comprising the first environment parameter is located; obtaininga feature vector corresponding to each of the MRs of the first terminalbased on the parameter information in each of the MRs of the firstterminal and the engineering parameter of the base station; processingthe first location information in each of the MRs of the first terminaland the feature vector corresponding to each of the MRs of the firstterminal using a machine learning model to obtain a single-pointpositioning model; and calculating the emission probability of thefeature vector corresponding to each of the MRs of the first terminalbased on the single-point positioning model, the first locationinformation in each of the MRs of the first terminal, and the featurevector corresponding to each of the MRs of the first terminal, whereinthe emission probability comprises an emission probability value,wherein the emission probability value indicates a probability that thefeature vector corresponds to a piece of first location information, andthe machine learning model is a regression model.